package wh.coach._compare;

/**
 * @author hangwen
 * @date 2023/7/3
 */
public class Point implements Comparable<Point> {

    private final long ts;
    private final Double value;

    public Point(final long ts, final Double value) {
        this.ts = ts;
        this.value = value;
    }

    @Override
    public int compareTo(final Point o) {
        if (o == null) {
            return 1;
        }

        return Long.compare(this.ts, o.ts);
    }

    public long getTs() {
        return ts;
    }

    public Double getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "ts:[" + this.ts + "],value:[" + this.value + "]";
    }
}
